//
//  RBDZContributeViewController.m
//  rubaoduanzi
//
//  Created by 李云飞 on 16/9/14.
//  Copyright © 2016年 liyunfei. All rights reserved.
//

#import "RBDZContributeViewController.h"
#import "RBDZVIewAddScroll.h"
@interface RBDZContributeViewController ()<UIScrollViewDelegate>
@property (weak, nonatomic) IBOutlet UITextView *textView;
@property (weak, nonatomic) IBOutlet UIView *viewAddScroll;
@property(nonatomic,strong)RBDZVIewAddScroll *scroll;
@end

@implementation RBDZContributeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.scroll=[[RBDZVIewAddScroll alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, self.viewAddScroll.frame.size.height)];
    [self.viewAddScroll addSubview:self.scroll];
    self.scroll.hidden=YES;
    [self addItem];
}
-(void)addItem{
    UIButton *buttonL=[UIButton buttonWithType:UIButtonTypeCustom];
    self.navigationItem.leftBarButtonItem=[RBDZButton barButtonItemWith:buttonL andTarget:self action:@selector(goToBack) andImageName:@"nav_back" andHightlightImage:@"nav_back_pre"];
    UIButton *buttonR=[UIButton buttonWithType:UIButtonTypeCustom];
    [buttonR setTitle:@"提交" forState:UIControlStateNormal];
    [buttonR setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [buttonR addTarget:self action:@selector(commit) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc]initWithCustomView:buttonR];
}
#pragma mark 返回
-(void)goToBack{
    [self.navigationController popToRootViewControllerAnimated:YES];
}
#pragma mark 提交
-(void)commit{
    NSLog(@"%s",__func__);
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark 添加图片
- (IBAction)pictuerBtn:(UIButton *)sender {
    sender.selected=!sender.selected;
}
#pragma mark 添加表情
- (IBAction)expressionBtn:(UIButton *)sender {
    sender.selected=!sender.selected;
    if (sender.selected) {
        self.scroll.hidden=NO;
    }else{
        self.scroll.hidden=YES;
    }
}

#pragma mark 添加电子邮件
- (IBAction)emailBtn:(UIButton *)sender {
}


@end
